﻿using System.Collections.Generic;
using System.Linq;

namespace DBConnection.Helper
{
    public class Table
    {
        #region Fields
        private List<Column> _columns;

        #endregion
        #region Contrutors
        public Table()
        {
            Name = "";
            _columns=new List<Column>();
        }
        public Table(string aName)
        {
            Name = aName;
            _columns = new List<Column>();
        }
        public Table(string aName,int aColumnCount)
        {
            Name = aName;
            _columns=new List<Column>(aColumnCount);
        }
        public Table(Table aTable)
        {
            Name = aTable.Name;
            _columns = new List<Column>(aTable.ColumnCount);
        }
        #endregion
        #region Properties
        public string Name { get; set; }
        public int ColumnCount
        {
            get { return _columns.Count; }
        }
        public Column Column
        {
            set { _columns.Add(value); }
        }

        public Column this[int i] { get { return _columns[i]; } }
        #endregion
    }
}
